﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Customer.Bussiness_Service;
using Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceCore;

namespace Customer.Areas.bug_submit.Controllers
{ 
    [ApiController, Area("bug_submit"), Route("/bug_submit/[action]")]
    public class bug_submitController : ControllerBase
    {
        private readonly Ibug_submit_service _service;
        private readonly IToole_DI _tool;
        public bug_submitController(Ibug_submit_service service, IToole_DI tool)
        {
            _service = service;
            _tool = tool;
        } 
        /// <summary>
        /// 保存BUG记录
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultObjModel sub_bug(save_bug Params)
        {
            var result = _service.sub_bug(Params);
            return result;
        }

        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultListModel<Entity.search_bug_submit> getpagelist(Base_List_Params query)
        {
            var result = _service.getpagelist(query);
            return result;
        } 
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpGet]
        public ResultObjModel del(string bug_submit_id)
        {
            var result = _service.del(bug_submit_id);
            return result;
        }
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpGet]
        public ResultObjModel change_state(string bug_submit_id, submit_state? submit_state)
        {
            var result = _service.change_state(bug_submit_id, submit_state);
            return result;
        }
    }
}